package com.cskaoyan.market.controller;

import com.cskaoyan.market.service.WxCollectService;
import com.cskaoyan.market.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @Author: 付诚
 * @Date: 2024/5/21 20:36
 * @Description:
 */
@RestController
@RequestMapping("/wx/Collect")
public class WxCollectController {
    @Autowired
    private WxCollectService wxCollectService;

    @GetMapping("list")

    public Object list(Integer type, Integer page, Integer limit) {

        List<Object> list = wxCollectService.list(type, page, limit);

        return ResponseUtil.okList(list);
    }

    @PostMapping("addordelete")
    public Object addordelete(@RequestBody Map<String,Integer> map) {
        Integer type = map.get("type");
        Integer valueId = map.get("valueId");

        wxCollectService.addordelete(type, valueId);
        return ResponseUtil.ok();
    }
}
